import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  //重定向
  {
    path: "/",
    redirect: "/one",
  },
  {
    path: "/one",
    name: "one",
    component: () => import("../views/OneYe.vue"),
    redirect: "/one/recommended",
    children: [
      {
        path: "recommended",
        name: "recommended",
        component: () => import("../views/OneYeChild/Recommended.vue"),
      },
      {
        path: "fresh",
        name: "fresh",
        component: () => import("../views/OneYeChild/Fresh.vue"),
      },
    ],
  },
  {
    path: "/two",
    name: "two",
    component: () => import("../views/TwoYe.vue"),
  },
  {
    path: "/three",
    name: "three",
    component: () => import("../views/ThreeYe.vue"),
  },
  {
    path: "/wode",
    name: "wode",
    component: () => import("../views/WoDe.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
